<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <a href="javascript:" @click="menu()">提交菜单</a>
  </div>
</template>

<script>
  // import HelloWorld3 from '@/components/HelloWorld3'
  import groupData from './groupData'

  export default {
    name: 'HelloWorld',
    data() {
      return {
        msg: 'Welcome to Your Vue.js App'
      }
    },
    mounted() {
      console.info(this.$router)
    },
    methods: {
      menu() {
        let data = JSON.stringify(groupData)
        let data2 = {
          "groupName": "groupName", // 组名
          "menuData": data, //  菜单数据
          "range": {  // 按钮数据
            "/index/delete": {  // 按钮接口
              "auth": true,  // 是否可以
              "name": "menu13页面删除按钮" // 按钮信息
            }
          },
        }
        this.$ajax.post('/index/addGroup', {data: data})
          .then(function (req) {
            console.info(req)
          }).catch(function (err) {

        })
      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  h1, h2 {
    font-weight: normal;
  }

  ul {
    list-style-type: none;
    padding: 0;
  }

  li {
    display: inline-block;
    margin: 0 10px;
  }

  a {
    color: #42b983;
  }
</style>
